package org.monkey.spring;

import org.monkey.service.AService;

public class JdkProxyBeanPostProcessor {

    public Object getEarlyBeanReference(Object bean, String beanName) {

        // 假设:A 被切点命中 需要创建代理  @PointCut("execution(* *..InstanceA.*(..))")
        if(bean instanceof MonkeyAop) {
            MonkeyDynamicProxyAopHandler jdkDynamicProxy = new MonkeyDynamicProxyAopHandler(bean);
            return  jdkDynamicProxy.getProxy();
        }
        return bean;
    }
}
